package cn.iocoder.yudao.module.handguard.dal.mysql.publicitytype;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.publicitytype.PublicityTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.admin.publicitytype.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 16个公示 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PublicityTypeMapper extends BaseMapperX<PublicityTypeDO> {

    default PageResult<PublicityTypeDO> selectPage(PublicityTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PublicityTypeDO>()
                .likeIfPresent(PublicityTypeDO::getTypeNames, reqVO.getTypeNames())
                .betweenIfPresent(PublicityTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(PublicityTypeDO::getId));
    }

    default List<PublicityTypeDO> selectList(PublicityTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<PublicityTypeDO>()
                .likeIfPresent(PublicityTypeDO::getTypeNames, reqVO.getTypeNames())
                .betweenIfPresent(PublicityTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PublicityTypeDO::getId));
    }

    List<PublicitySelectBaseVO> getPublicitySelectListByClassName(@Param("className") String className,@Param("typesName") String typesName);

    List<PublicitySelectBaseVO> getPublicitySelectListByTypesName(@Param("typesName") String typesName,@Param("orderId") Long orderId);
}
